#!/usr/bin/python

import os, sys, optparse, time, random
import pygame
from lettergame import LetterGame

def parse_args():
  parser = optparse.OptionParser()

  parser.add_option('-g', '--geometry', default='1024x768')
  parser.add_option('-T', '--tick', default=0)
  parser.add_option('-F', '--fullscreen', action='store_true', default=False)
  parser.add_option('-M', '--max-sprites', default=0)

  return parser.parse_args()

def main():
  os.environ['SDL_VIDEO_CENTERED'] = '1'
  opts, args = parse_args()

  size = [int(x) for x in opts.geometry.split('x')]

  game = LetterGame(size = size,
      fullscreen = opts.fullscreen, 
      maxSprites = int(opts.max_sprites),
      tick = int(opts.tick))
  game.run()

if __name__ == '__main__': main()

